package easy

func AddDigits(num int) int {
	for num >= 10 {
		sum := 0
		for num > 0 {
			temp := num % 10
			sum += temp
			num /= 10
		}
		num = sum
	}
	return num
}
